package squirrel

import scala.util.{Success, Try}

sealed trait SqlFrom {
  def toSQL: Try[ParameterizedSQL]
}
case class SqlFromSimple(tableName: String) extends SqlFrom {
  override def toSQL: Try[ParameterizedSQL] =
    Success(ParameterizedSQL(tableName, Seq()))
}
case class SqlFromAlias(tableName: String, alias: String) extends SqlFrom {
  override def toSQL: Try[ParameterizedSQL] =
    Success(ParameterizedSQL(s"($tableName) AS $alias", Seq()))
}

case class SqlFromSubQuery(subQuery: SqlSelectAst, alias: String)
    extends SqlFrom {
  override def toSQL: Try[ParameterizedSQL] = ???
}
